package com.matthicks.delegates;

import java.util.concurrent.Callable;

public class CallableDelegate implements Delegate {
	private Callable<?> callable;
	
	public CallableDelegate(Callable<?> callable) {
		this.callable = callable;
	}
	
	public Object invoke(Object... args) {
		try {
			return callable.call();
		} catch(Exception exc) {
			// TODO: add better handling
			exc.printStackTrace();
		}
		return null;
	}
}
